package com.yqg.education.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yqg.education.cover.LocalDateTimeConverter;
import com.yqg.education.cover.SexConverter;
import io.swagger.annotations.ApiModel;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * user 实体类
 *
 * @author zxf
 * @since 2025-03-01
 */
@Getter
@Setter
@ApiModel(value = "User对象", description = "")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @ExcelProperty(value = "用户ID",index = 0)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ExcelProperty(value = "用户名",index = 1)
    private String username;

    @ExcelIgnore
    private String password;

    @ExcelProperty(value = "班级编号",index = 2)
    @TableField(exist = false)
    private String trainClassNum;

    @ExcelProperty(value = "创建时间", index = 3, converter = LocalDateTimeConverter.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    @ExcelProperty(value = "修改时间", index = 4, converter = LocalDateTimeConverter.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;

    @ExcelProperty(value = "性别", index = 5, converter = SexConverter.class)
    private Integer sex;

    @ExcelProperty(value = "年龄",index = 6)
    private Integer age;

    @ExcelIgnore
    private String photo;

    @ExcelProperty(value = "手机号",index = 7)
    private String telephone;

    @ExcelProperty(value = "邮箱",index = 8)
    private String email;

    @ExcelProperty(value = "单位",index = 9)
    private String unit;

    @ExcelProperty(value = "部门",index = 10)
    private String department;

    @ExcelProperty(value = "科室",index = 11)
    private String section;

    @ExcelIgnore
    private Integer isDelete;

    @ExcelIgnore
    @TableField(exist = false)
    private List<Long> roleIds;

    @ExcelIgnore
    @TableField(exist = false)
    private Integer classId;
}
